@namespace SwashbucklerDiary.Rcl.Pages
@inherits ImportantComponentBase

<MCard Class="mb-5"
       Elevation="0"
       Rounded="@("lg")">
    <MList Class="py-0"
           TwoLine>
        <MListItem OnClick="Export">
            <MListItemIcon>
                <MIcon>
                    mdi:mdi-export
                </MIcon>
            </MListItemIcon>
            <MListItemContent>
                <MListItemTitle>
                    <wc-auto-scroll-text>@(I18n.T("Export"))</wc-auto-scroll-text>
                </MListItemTitle>
                <MListItemSubtitle Class="text-caption-xs-only">
                    <wc-auto-scroll-text>@(I18n.T("txt, md, json, xlsx"))</wc-auto-scroll-text>
                </MListItemSubtitle>
            </MListItemContent>
            <MListItemAction>
                <MIcon>chevron_right</MIcon>
            </MListItemAction>
        </MListItem>

        <MDivider Class="mx-5"></MDivider>

        <MListItem OnClick="() => showImport = true">
            <MListItemIcon>
                <MIcon>
                    mdi:mdi-import
                </MIcon>
            </MListItemIcon>
            <MListItemContent>
                <MListItemTitle>
                    <wc-auto-scroll-text>@(I18n.T("Import"))</wc-auto-scroll-text>
                </MListItemTitle>
                <MListItemSubtitle Class="text-caption-xs-only">
                    <wc-auto-scroll-text>@(I18n.T("Import zip files in the corresponding format"))</wc-auto-scroll-text>
                </MListItemSubtitle>
            </MListItemContent>
            <MListItemAction>
                <MIcon>chevron_right</MIcon>
            </MListItemAction>
        </MListItem>
    </MList>
</MCard>

<ExportDialog @bind-Visible="showExport"
              Value="diaries">
</ExportDialog>

<MultiListDialog @bind-Visible="showImport"
                 Title="@(I18n.T("Select the import file format"))"
                 DynamicListItems="importTypes">
</MultiListDialog>

<CustomMDialog @bind-MyValue="showConfirmImport"
               ContentClass="rounded-lg"
               MaxWidth="420">
    <MCard>
        <MCardTitle Class="font-weight-bold flex-nowrap">
            <wc-auto-scroll-text>@(I18n.T("Confirm import"))</wc-auto-scroll-text>
            <MSpacer></MSpacer>
            <MButton Icon
                     OnClick="@(()=>showConfirmImport=false)">
                <MIcon>close</MIcon>
            </MButton>
        </MCardTitle>
        <MCardText Class="pb-0">
            @(I18n.T("Confirm importing these diaries?"))
        </MCardText>
        <MCardActions>
            <MSpacer></MSpacer>
            <MButton Text
                     OnClick="()=>showConfirmImport=false">
                @(I18n.T("Cancel"))
            </MButton>
            <MButton Text
                     Color="primary"
                     OnClick="ConfirmImport">
                @(I18n.T("OK"))
            </MButton>
        </MCardActions>
    </MCard>
</CustomMDialog>